<?php
/**
 * Created by PhpStorm.
 * User: lzy 林子彦
 * Date: 2018/12/9
 * Time: 上午2:06
 */

namespace App\Content\Controllers\Home;

use App\Base\Controllers\Controller;
use App\Content\Contracts\WxUsersInterface;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;


/**
 * 用户关注
 * Class WxUserController
 * @package App\Content\Controllers\Home
 */
class UserFollowController extends Controller
{

    /**
     * 我的关注
     * @return WxUsersInterface
     */
    public function getWxUsersInterface()
    {
        return app()->make(WxUsersInterface::class);
    }

    public function setUserFollow(Request $request)
    {
        $validator = Validator::make($request->all(), [
            'sid' => 'required',
        ]);

        if ($validator->fails()) {
            $this->throwValidatorException($validator);
        }
        return $this->getWxUsersInterface()->setUserFollow($request->except("data","token"));
    }

    public function getUserMyFollow(Request $request){
        return $this->getWxUsersInterface()->getUserMyFollow($request->except("data","token"));
    }
}